<template>
	<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="lower" :enable-flex="true"
		style="width: 100%;height: 100vh;">
		<!-- 容器 -->

		<view
			style="width: 100%; margin-top: 40rpx;display: flex;flex-direction: column;align-items: center;justify-content: center;">
			<!-- 当前所在团队 -->
			<text style="width: 702rpx; font-size: 32rpx;color: #333333;" class="text-bold">当前所在团队</text>
			<!-- 团队item -->
		</view>
		<block v-for="(item,index) in data" :key="index">
			<view class="margin b bg-withe padding-lr  padding-tb-xs radius flex align-center">
				<view class="">
					<text class="cu-tag bg-gradual-green round">{{item.grade_name}}</text>
				</view>
				<view class="flex-sub justify-center flex ">
					<image :src="'http://jiyou.qianjiwl.xyz'+ item.avatar  " mode="" style="width: 90rpx; height: 90rpx;" class="round"></image>
				</view>
				<view class="flex-sub justify-center flex text-cut">
					<text>{{item.nickname}}</text>
				</view>
				<view class="flex-sub  flex flex-direction justify-around text-df align-center">
					<text>{{item.username}}</text>
					<text>{{item.createtime | ddd}}</text>
				</view>
			</view>
		</block>
		
	</scroll-view>
</template>

<script>
	export default {
		data() {
			return {
				data: [],
				
			};
		},
		onShow() {
			this.data =  uni.getStorageSync('list')
			console.log("this.data: ",this.data);
			
		},
		methods: {
			lower() {
				console.log('到达底部了');
			},

			async getbrowseList() {
				const res = await this.$api('my_my_insert_team');
				this.data = res.data;
				console.log('res :>> ', res);
			},
			async my_sales_team() {
				const res = await this.$api('my_sales_team');
				this.data11 = res.data;
				console.log('data11 :>> ', this.data11);
			},
			ddd(msg) {

				//讲字符串转为Date格式
				var msg1 = msg * 1000
				var mt = new Date(msg1);
				//获取年份
				var year = mt.getFullYear();
				//从0开始，获取月份
				var month = (mt.getMonth() + 1).toString().padStart(2, '0');
				//获取天数
				var day = mt
					.getDay()
					.toString()
					.padStart(2, '0');
				/* if (con === 'yyyy/mm/dd'){
			                return year + "/" + month + "/" + day;
			            }*/
				//获取小时
				var hh = mt
					.getHours()
					.toString()
					.padStart(2, '0');
				//获取分钟
				var mm = mt
					.getMinutes()
					.toString()
					.padStart(2, '0');
				//获取秒
				var ss = mt
					.getSeconds()
					.toString()
					.padStart(2, '0');

				return year + '-' + month + '-' + day
				//+ hh + ':' + mm + ':' + ss;



			}

		},
		filters: {
			ddd(msg){
				//讲字符串转为Date格式
				var msg1 = msg*1000
				
				var mt = new Date(msg1);
				//获取年份
				var year = mt.getFullYear();
				//从0开始，获取月份
				var month = (mt.getMonth() + 1).toString().padStart(2, '0');
				//获取天数
				var day = mt
					.getDay()
					.toString()
					.padStart(2, '0');
				/* if (con === 'yyyy/mm/dd'){
				            return year + "/" + month + "/" + day;
				        }*/
				//获取小时
				var hh = mt
					.getHours()
					.toString()
					.padStart(2, '0');
				//获取分钟
				var mm = mt
					.getMinutes()
					.toString()
					.padStart(2, '0');
				//获取秒
				var ss = mt
					.getSeconds()
					.toString()
					.padStart(2, '0');
				
				return year + '-' + month + '-' + day 
				//+ hh + ':' + mm + ':' + ss;
			}
		},
	};
</script>

<style lang="scss" scoped>
page {
		background-color: #f9f9f9;
	text {
		font-family: PingFang SC;
		white-space: nowrap;
	}
}
</style>
